package com.yq.tanhua.utils

import com.fmt.mvi.learn.gobal.log
import com.yq.tanhua.net.bean.UserInfo
import com.yq.tanhua.ui.USER_INFO
import mmkv.SpUtils

object UserCenter {
    fun updateUserInfo(userInfo: UserInfo) {
        SpUtils.put(USER_INFO, userInfo)
        this.userInfo = userInfo
        "保持了用户信息".log()
    }

    var userInfo: UserInfo? = null
        get() {
            if(field !=null){
                return field
            }
            field = SpUtils.getParcelable(USER_INFO)
            return field
        }
}